package org.thread.Homework;/*
 *@Author: gjh
 *Date: 2025/3/10 19:12
 *Describe:
 */

import java.util.concurrent.Callable;

public class MyCallable implements Callable<Integer> {
    // 参数1
    public Integer num1;
    // 参数2
    public Integer num2;

    public MyCallable(Integer num1, Integer num2) {
        this.num1 = num1;
        this.num2 = num2;
    }

    @Override
    public Integer call() throws Exception {
        Integer sum = 0;
        for(Integer i = num1;i<=num2;i++){
            sum += i;
        }
        return sum;
    }
}
